<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BaseBean
 *
 * @author Administrator
 */

namespace frontend\bean;

class BaseBean implements \ArrayAccess {
    
    
    public function offsetExists($offset) {
        
    }
    
        function load($values) {

        $reflect = new \ReflectionClass($this);
        $attributes = $reflect->getDefaultProperties();
      
        foreach ($values as $name => $value) {

            if (array_key_exists($name,$attributes)) {

                $this->{$name} = $value;
            }
        }
        return $this;
    }

    public function offsetGet($offset) {
       
        return $this->{$offset};
    }

    public function offsetSet($offset, $value) {
        $this->{$offset} = $value;
    }

    public function offsetUnset($offset) {
        
    }

//put your code here
}
